<template>
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div>
          <div class="details-title">{{$t('zz.access_scenario')}}</div>
          <zz-card>
            <p slot="content">{{$t('zz.server.net.intro')}}</p>
            <img
              src="@/assets/img/networkIntrusion/networkIntrusion1-1.png"
              slot="img"
              alt=""
              width="420"
            />
          </zz-card>
        </div>
        <div >
          <div class="details-title">{{$t('zz.characteristic_service')}}</div>
          <div class="flex-3">
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.net.service.name1')}}</span>
                <p slot="content">{{$t('zz.server.net.service.intro1')}}</p>
                <img
                  src="@/assets/img/networkIntrusion/networkIntrusion2-1.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.net.service.name2')}}</span>
                <p slot="content">{{$t('zz.server.net.service.intro2')}}</p>
                <img
                  src="@/assets/img/networkIntrusion/networkIntrusion2-2.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border  titleSize="small">
                <span slot="title">{{$t('zz.server.net.service.name3')}}</span>
                <p slot="content">{{$t('zz.server.net.service.intro3')}}</p>
                <img
                  src="@/assets/img/networkIntrusion/networkIntrusion2-3.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
          </div>
        </div>
        <div class="content-sub-nav-wrap">
          <div class="details-title">{{$t('zz.application_scenarios')}}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper" style="width: 600px">
              <li
                v-for="(item, i) in list[2].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{ isPC ? item.name : item.pcname }}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 1">
            <img
            :src="$t('zz.img.networkIntrusion3-1')"
              alt=""
            />
            <h6 class="list-title">{{$t('zz.applicable_scene')}}</h6>
            <ul class="list-has-poi">
              <li>{{$t('zz.server.net.service.use1')}}</li>
              <li>{{$t('zz.server.net.service.use2')}}</li>
            </ul>
            <h6 class="list-title">{{$t('zz.solution')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use3')}}
              </li>
              <li>
                {{$t('zz.server.net.service.use4')}}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 2">
            <img
              :src="$t('zz.img.networkIntrusion3-2')"
              alt=""
            />
            <h6 class="list-title">{{$t('zz.applicable_scene')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use5')}}
              </li>
            </ul>
            <h6 class="list-title">{{$t('zz.solution')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use6')}}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 3">
            <img
              :src="$t('zz.img.networkIntrusion3-3')"
              alt=""
            />
            <h6 class="list-title">{{$t('zz.applicable_scene')}}</h6>
            <ul class="list-has-poi">
              <li>{{$t('zz.server.net.service.use7')}}</li>
              <li>{{$t('zz.server.net.service.use8')}}</li>
            </ul>
            <h6 class="list-title">{{$t('zz.solution')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use9')}}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 4">
            <img
              :src="$t('zz.img.networkIntrusion3-4')"
              alt=""
            />
            <h6 class="list-title">{{$t('zz.applicable_scene')}}</h6>
            <ul class="list-has-poi">
              <li>{{$t('zz.server.net.service.use10')}}</li>
              <li>{{$t('zz.server.net.service.use11')}}</li>
              <li>{{$t('zz.server.net.service.use12')}}</li>
              <li>{{$t('zz.server.net.service.use13')}}</li>
            </ul>
            <h6 class="list-title">{{$t('zz.solution')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use14')}}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 5">
            <img
              :src="$t('zz.img.networkIntrusion3-5')"
              alt=""
            />
            <h6 class="list-title">{{$t('zz.applicable_scene')}}</h6>
            <ul class="list-has-poi">
              <li>{{$t('zz.server.net.service.use15')}}</li>
              <li>{{$t('zz.server.net.service.use16')}}</li>
            </ul>
            <h6 class="list-title">{{$t('zz.solution')}}</h6>
            <ul class="list-has-poi">
              <li>
                {{$t('zz.server.net.service.use17')}}
              </li>
              <li>
                {{$t('zz.server.net.service.use18')}}
              </li>
            </ul>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import { mapGetters } from 'vuex'

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
      height: 250,
      titleSize: 20,
      
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    ...mapGetters({
      isPC: 'isPC'
    }),
    list: function(){ return [
        { name: this.$t('zz.product_presentation'), index: 1 },
        { name: this.$t('zz.characteristic_service'), index: 2 },
        {
          name: this.$t('zz.application_scenarios'),
          index: 3,
          child: [
            { name: this.$t('zz.server.net.service.sub1'), index: 1, pcname: this.$t('zz.server.net.service.sub1.little') },
            { name: this.$t('zz.server.net.service.sub2'), index: 2, pcname: this.$t('zz.server.net.service.sub2.little') },
            { name: this.$t('zz.server.net.service.sub3'), index: 3, pcname: this.$t('zz.server.net.service.sub3.little') },
            { name: this.$t('zz.server.net.service.sub4'), index: 4, pcname: this.$t('zz.server.net.service.sub4.little') },
            { name: this.$t('zz.server.net.service.sub5'), index: 5, pcname: this.$t('zz.server.net.service.sub5.little') },
          ],
        },
      ]
    },
  },
  watch: {},
  methods: {
    navClick(a_item) {
      console.log(a_item);
      this.subIndex = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
    max-width: 100%;
  }
  & > ul {
    width: auto;
    margin: 0 auto;
  }
}
.son-pro-wrap {
  display: flex;
  // justify-content: space-between;
  margin-top: 48px;
  flex-wrap: wrap;
  & > div {
    width: 240px;
    margin-right: 40px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 22px;
        line-height: 32px;
        margin: 15px 0 20px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 25px;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
.list-has-poi {
  list-style-type: disc;
  li {
    list-style-type: disc;
  }
}
</style>